#include <stdio.h>
int main()
{int n;
    scanf("%d",&n);
int f[n];
int z;
int max;
int m;
int i;
scanf("%d",&m);
f[0]=m;
max=m;
for(i=1;i<n;i++)
{scanf("%d",&m);

    f[i]=m;

    if(max<=m)
    {max=m;
    z=i;
    }

}

    printf("%d %d",max,z);
    return 0;
}

